﻿using System;
using System.IO;

using NUnit.Framework;

namespace Yawf.Core.Utils {
	[TestFixture]
	public class ResourceUtilsTest {
		[Test]
		public void TestGetResource() {
			FileInfo fileResource;

			fileResource = ResourceUtils.GetFileResource("file://" + AppDomain.CurrentDomain.BaseDirectory + "/TestView.xml");
			Assert.IsNotNull(fileResource,"fileResource == null");
		}

		[Test]
		public void TestDoResourceExists() {
			bool test;

			test = ResourceUtils.DoResourceExists("file://" + AppDomain.CurrentDomain.BaseDirectory + "/TestView.xml");
			Assert.IsTrue(test,"File TestView.xml should exist but does not");

			test = ResourceUtils.DoResourceExists("file://" + AppDomain.CurrentDomain.BaseDirectory + "/Test.xml");
			Assert.IsFalse(test,"File Test.xml should not exist but does");
		}
	}
}
